﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace TPCN.DAL
{
    public class DonDatHangObj
    {
        private const string KEY_NOT_CONFIRM = "1";
        private const string KEY_CONFIRM = "2";
        private const string KEY_DELIVERING = "3";
        private const string KEY_DELIVERED = "4";
        private const string KEY_PAID = "5";

        private string _DondathangID;

        public string DondathangID
        {
            get { return _DondathangID; }
            set { _DondathangID = value; }
        }
        private string _Ngaylap;

        public string Ngaylap
        {
            get { return _Ngaylap; }
            set { _Ngaylap = value; }
        }
        private string _KhachID;

        public string KhachID
        {
            get { return _KhachID; }
            set { _KhachID = value; }
        }

        private string _PhuongthucthanhtoanID;

        public string PhuongthucthanhtoanID
        {
            get { return _PhuongthucthanhtoanID; }
            set { _PhuongthucthanhtoanID = value; }
        }
        private string _Active;

        public string Active
        {
            get { return _Active; }
            set { _Active = value; }
        }

        private string _Hotennguoinhan;

        public string Hotennguoinhan
        {
            get { return _Hotennguoinhan; }
            set { _Hotennguoinhan = value; }
        }
        private string _Sodienthoai;

        public string Sodienthoai
        {
            get { return _Sodienthoai; }
            set { _Sodienthoai = value; }
        }
        private string _Diachinhanhang;

        public string Diachinhanhang
        {
            get { return _Diachinhanhang; }
            set { _Diachinhanhang = value; }
        }

        private string _Ghichu;

        public string Ghichu
        {
            get { return _Ghichu; }
            set { _Ghichu = value; }
        }

        private string _Hinhthucnhanhang;

        public string Hinhthucnhanhang
        {
            get { return _Hinhthucnhanhang; }
            set { _Hinhthucnhanhang = value; }
        }

        public DonDatHangObj SetValuesFromDataReader(IDataReader reader)
        {
            DonDatHangObj obj = new DonDatHangObj();
            obj.DondathangID = (reader["DondathangID"] is DBNull) ? String.Empty : reader["DondathangID"].ToString();
            obj.Ngaylap = (reader["Ngaylap"] is DBNull) ? String.Empty : reader["Ngaylap"].ToString();
            obj.KhachID = (reader["KhachID"] is DBNull) ? String.Empty : reader["KhachID"].ToString();
            obj.PhuongthucthanhtoanID = (reader["PhuongthucthanhtoanID"] is DBNull) ? String.Empty : reader["PhuongthucthanhtoanID"].ToString();
            obj.Active = (reader["Active"] is DBNull) ? String.Empty : reader["Active"].ToString();
            obj.Hotennguoinhan = (reader["Hotennguoinhan"] is DBNull) ? String.Empty : reader["Hotennguoinhan"].ToString();
            obj.Sodienthoai = (reader["Sodienthoai"] is DBNull) ? String.Empty : reader["Sodienthoai"].ToString();
            obj.Diachinhanhang = (reader["Diachinhanhang"] is DBNull) ? String.Empty : reader["Diachinhanhang"].ToString();
            obj.Ghichu = (reader["Ghichu"] is DBNull) ? String.Empty : reader["Ghichu"].ToString();
            obj.Hinhthucnhanhang = (reader["Hinhthucnhanhang"] is DBNull) ? String.Empty : reader["Hinhthucnhanhang"].ToString();
            return obj;
        }
    }
}
